class VideoChatModel {
  String? roomId;
  int? type;
  int? fromUid;
  String? fromNickname;
  String? fromRemarkName;
  String? fromAvatar;
  String? fromTag;
  String? fromIcon;
  int? toUid;
  String? toNickname;
  String? toAvatar;
  String? toTag;
  String? toIcon;
  String? agoraToken;
  String? socketUrl;
  VideoChatSkill? skill;
  VideoChatPornCheckV2? pornCheckV2;
  VideoChatGuard? guard;

  VideoChatModel(
      {roomId,
      type,
      fromUid,
      fromNickname,
      fromRemarkName,
      fromAvatar,
      fromTag,
      fromIcon,
      toUid,
      toNickname,
      toAvatar,
      toTag,
      toIcon,
      agoraToken,
      socketUrl,
      skill,
      pornCheckV2,
      guard});

  VideoChatModel.fromJson(Map<String, dynamic> json) {
    roomId = json['room_id'].toString();
    type = json['type'];
    fromUid = json['from_uid'];
    fromNickname = json['from_nickname'];
    fromRemarkName = json['from_remark_name'];
    fromAvatar = json['from_avatar'];
    fromTag = json['from_tag'];
    fromIcon = json['from_icon'];
    toUid = json['to_uid'];
    toNickname = json['to_nickname'];
    toAvatar = json['to_avatar'];
    toTag = json['to_tag'];
    toIcon = json['to_icon'];
    agoraToken = json['agora_token'];
    socketUrl = json['socket_url'];
    skill =
        json['skill'] != null ? VideoChatSkill.fromJson(json['skill']) : null;
    pornCheckV2 = json['porn_check_v2'] != null
        ? VideoChatPornCheckV2.fromJson(json['porn_check_v2'])
        : null;
    guard =
        json['guard'] != null ? VideoChatGuard.fromJson(json['guard']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['room_id'] = roomId;
    data['type'] = type;
    data['from_uid'] = fromUid;
    data['from_nickname'] = fromNickname;
    data['from_remark_name'] = fromRemarkName;
    data['from_avatar'] = fromAvatar;
    data['from_tag'] = fromTag;
    data['from_icon'] = fromIcon;
    data['to_uid'] = toUid;
    data['to_nickname'] = toNickname;
    data['to_avatar'] = toAvatar;
    data['to_tag'] = toTag;
    data['to_icon'] = toIcon;
    data['agora_token'] = agoraToken;
    data['socket_url'] = socketUrl;
    if (skill != null) {
      data['skill'] = skill!.toJson();
    }
    if (pornCheckV2 != null) {
      data['porn_check_v2'] = pornCheckV2!.toJson();
    }
    if (guard != null) {
      data['guard'] = guard!.toJson();
    }
    return data;
  }
}

class VideoChatSkill {
  int? id;
  String? name;
  String? icon;
  int? price;
  int? score;
  int? serviceCount;
  int? serviceTime;

  VideoChatSkill({id, name, icon, price, score, serviceCount, serviceTime});

  VideoChatSkill.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    icon = json['icon'];
    price = json['price'];
    score = json['score'];
    serviceCount = json['service_count'];
    serviceTime = json['service_time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['icon'] = icon;
    data['price'] = price;
    data['score'] = score;
    data['service_count'] = serviceCount;
    data['service_time'] = serviceTime;
    return data;
  }
}

class VideoChatPornCheckV2 {
  int? isOpen;
  int? interval;
  List<VideoChatPornperiodArray>? periodArray;
  int? hasDkIncomeCoin;
  int? checkFromUser;
  int? hasDkIncomeDuration;
  int? timeNum;
  int? newUserTime;
  int? hasDkForbidden;

  VideoChatPornCheckV2(
      {isOpen,
      interval,
      periodArray,
      hasDkIncomeCoin,
      checkFromUser,
      hasDkIncomeDuration,
      timeNum,
      newUserTime,
      hasDkForbidden});

  VideoChatPornCheckV2.fromJson(Map<String, dynamic> json) {
    isOpen = json['is_open'];
    interval = json['interval'];
    if (json['period_array'] != null) {
      periodArray = <VideoChatPornperiodArray>[];
      json['period_array'].forEach((v) {
        periodArray!.add(VideoChatPornperiodArray.fromJson(v));
      });
    }
    hasDkIncomeCoin = json['has_dk_income_coin'];
    checkFromUser = json['check_from_user'];
    hasDkIncomeDuration = json['has_dk_income_duration'];
    timeNum = json['time_num'];
    newUserTime = json['new_user_time'];
    hasDkForbidden = json['has_dk_forbidden'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['is_open'] = isOpen;
    data['interval'] = interval;
    if (periodArray != null) {
      data['period_array'] = periodArray!.map((v) => v.toJson()).toList();
    }
    data['has_dk_income_coin'] = hasDkIncomeCoin;
    data['check_from_user'] = checkFromUser;
    data['has_dk_income_duration'] = hasDkIncomeDuration;
    data['time_num'] = timeNum;
    data['new_user_time'] = newUserTime;
    data['has_dk_forbidden'] = hasDkForbidden;
    return data;
  }
}

class VideoChatPornperiodArray {
  int? start;
  int? end;
  VideoChatPornperiodArray({start, end});

  VideoChatPornperiodArray.fromJson(Map<String, dynamic> json) {
    start = json['start'];
    end = json['end'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['start'] = start;
    data['end'] = end;
    return data;
  }
}

class VideoChatGuard {
  int? diffNum;
  String? guardPrice;

  VideoChatGuard({diffNum, guardPrice});

  VideoChatGuard.fromJson(Map<String, dynamic> json) {
    diffNum = json['diff_num'];
    guardPrice = json['guard_price'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['diff_num'] = diffNum;
    data['guard_price'] = guardPrice;
    return data;
  }
}
